home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
sos3-2.lha
/
src
/
agg
/
Collection.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-01-23
|
2KB
|
50 lines
/* --------------------------------------------------------------------------
* Copyright 1992 by Forschungszentrum Informatik (FZI)
*
* You can use and distribute this software under the terms of the licence
* you should have received along with this program.
* If not or if you want additional information, write to
* Forschungszentrum Informatik, "STONE", Haid-und-Neu-Strasse 10-14,
* D-7500 Karlsruhe 1, Germany.
* --------------------------------------------------------------------------
*/
// **************************************************************************
// Module Collection 30/06/89 Bernhard Schiefer (bs)
// modified : 24/01/90 (bs)
// **************************************************************************
// implements methods of classes: Collection
// **************************************************************************
#include "sys.h"
#include "agg_err.h"
#include "trc_agg.h"
#include "agg_sos.h"
// **************************************************************************
sos_Bool sos_Object_Collection::is_element (sos_Object o)
// **************************************************************************
{
// The function tests if an object is an element of the aggregate.
// The test may be based on equality or identity, depending on
// the value of the "based_on_equal" attribute.
T_PROC ("sos_Object_Collection::is_element");
TT (agg_H, T_ENTER);
sos_Bool result = FALSE;
sos_Object_Collection c = self;
sos_Bool based_on_equal = self.get_based_on_equal();
agg_iterate (c, sos_Object elem)
{ if (agg_same_entity (o, elem, based_on_equal, EQ_STRONG))
{ result = TRUE;
break;
}
}
agg_iterate_end (c, elem);
TT (agg_H, T_LEAVE);
return result;
} // ** is_element **